package com.example.ruoyiakp.agricul.service.impl;

import com.example.ruoyiakp.agricul.domain.AgrAgriculturalSupplies;
import com.example.ruoyiakp.agricul.mapper.AgrAgriculturalSuppliesMapper;
import com.example.ruoyiakp.agricul.service.IAgrAgriculturalSuppliesService;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 农资管理Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class AgrAgriculturalSuppliesServiceImpl implements IAgrAgriculturalSuppliesService
{
    @Resource
    private AgrAgriculturalSuppliesMapper agrAgriculturalSuppliesMapper;

    /**
     * 查询农资管理
     *
     * @param suppId 农资管理主键
     * @return 农资管理
     */
    @Override
    public AgrAgriculturalSupplies selectAgrAgriculturalSuppliesBySuppId(Long suppId)
    {
        return agrAgriculturalSuppliesMapper.selectAgrAgriculturalSuppliesBySuppId(suppId);
    }

    /**
     * 查询农资管理列表
     *
     * @param agrAgriculturalSupplies 农资管理
     * @return 农资管理
     */
    @Override
    public List<AgrAgriculturalSupplies> selectAgrAgriculturalSuppliesList(AgrAgriculturalSupplies agrAgriculturalSupplies)
    {
        return agrAgriculturalSuppliesMapper.selectAgrAgriculturalSuppliesList(agrAgriculturalSupplies);
    }

    /**
     * 新增农资管理
     *
     * @param agrAgriculturalSupplies 农资管理
     * @return 结果
     */
    @Override
    public int insertAgrAgriculturalSupplies(AgrAgriculturalSupplies agrAgriculturalSupplies)
    {
        agrAgriculturalSupplies.setCreateTime(DateUtils.getNowDate());
        return agrAgriculturalSuppliesMapper.insertAgrAgriculturalSupplies(agrAgriculturalSupplies);
    }

    /**
     * 修改农资管理
     *
     * @param agrAgriculturalSupplies 农资管理
     * @return 结果
     */
    @Override
    public int updateAgrAgriculturalSupplies(AgrAgriculturalSupplies agrAgriculturalSupplies)
    {
        agrAgriculturalSupplies.setUpdateTime(DateUtils.getNowDate());
        return agrAgriculturalSuppliesMapper.updateAgrAgriculturalSupplies(agrAgriculturalSupplies);
    }

    /**
     * 批量删除农资管理
     *
     * @param suppIds 需要删除的农资管理主键
     * @return 结果
     */
    @Override
    public int deleteAgrAgriculturalSuppliesBySuppIds(Long[] suppIds)
    {
        return agrAgriculturalSuppliesMapper.deleteAgrAgriculturalSuppliesBySuppIds(suppIds);
    }

    /**
     * 删除农资管理信息
     *
     * @param suppId 农资管理主键
     * @return 结果
     */
    @Override
    public int deleteAgrAgriculturalSuppliesBySuppId(Long suppId)
    {
        return agrAgriculturalSuppliesMapper.deleteAgrAgriculturalSuppliesBySuppId(suppId);
    }
}
